package Work3;

public class wallet {
	private int Money;
	private void setMoney(int money) {
		this.Money=money;
	}
	public int getMoney() {
		return this.Money;
	}
	public boolean Pay(int money) {
		if(money<=getMoney()) {
			money=getMoney()-money;
			setMoney(money);
			return true;
		}else {
			System.out.println("余额不足");
			return false;
		}
	}
	public void Get(int money) {
		money=getMoney()+money;
		setMoney(money);
	}
	
}
